// 合并数组
let first = [ '蝎子精', '蜘蛛精', '蜈蚣精', '玉兔精' ];
let second = [ '蟒蛇精', '大鹏鸟', '六耳猕猴' ];

// Array.prototype.concat(...array)
let third = first.concat( second );
console.log( third === first ); // false
console.log( third === second ); // false
console.log( third.toString() );

// 将数组各元素连接到一个字符串中
// Array.prototype.join( [ separator ] )
let str = third.join(';');
console.log( str );

// 截取子集
// Array.prototype.slice( [ start [, end] ] )
let fourth = third.slice();
console.log( fourth === third ); // false
console.log( fourth.toString() );

// slice(start) 截取从start处开始至数组末尾的元素并返回新数组
let fifth = third.slice( 3 );
console.log( fifth );

// slice(start,end) 截取数组中[start, end)之间的元素并返回新数组
let sixth = third.slice( 3, 5 );
console.log( sixth );
// 若 slice 中的参数值为负数则表示从数组末尾倒数
console.log( third.slice( -4, -2 ));

// 总结:
// Array.prototype.concat( ...array )
// Array.prototype.join([separator])
// Array.prototype.slice( [ start [, end] ] )